package com.ajk.server.security;

import java.util.Collection;
import java.util.Date;
import java.util.List;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

public class AjkUserDetails implements UserDetails {
	
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private List<GrantedAuthority> authorities;
    private Integer userId;
    private String userName;
    private String accessKey;
    private Date accountExpiredTime;
    
    

	public AjkUserDetails(List<GrantedAuthority> authorities, Integer userId, String userName, String accessKey,
			Date accountExpiredTime) {
		super();
		this.authorities = authorities;
		this.userId = userId;
		this.userName = userName;
		this.accessKey = accessKey;
		this.accountExpiredTime = accountExpiredTime;
	}

	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		return authorities;
	}

	@Override
	public String getPassword() {
		return null;
	}

	@Override
	public String getUsername() {
		return userName;
	}

	@Override
	public boolean isAccountNonExpired() {
		return false;
	}

	@Override
	public boolean isAccountNonLocked() {
		return false;
	}

	@Override
	public boolean isCredentialsNonExpired() {
		return false;
	}

	@Override
	public boolean isEnabled() {
		return true;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getAccessKey() {
		return accessKey;
	}

	public void setAccessKey(String accessKey) {
		this.accessKey = accessKey;
	}

	public Date getAccountExpiredTime() {
		return accountExpiredTime;
	}

	public void setAccountExpiredTime(Date accountExpiredTime) {
		this.accountExpiredTime = accountExpiredTime;
	}

	public void setAuthorities(List<GrantedAuthority> authorities) {
		this.authorities = authorities;
	}
	
	

}
